﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Z2102WinForms.LX
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            label1.Text = "上机练习1 格式化输出（要求分别用Console和WinForms实现）。";
            label2.AutoEllipsis = true;

            panel1.Visible = false;
            buttonConsole.Click += delegate
            {
                Program.ExecConsoleApp("Z2102Console.LX.Class1");
            };
            buttonWinForms.Click += delegate
            {
                panel1.Visible = true;

                string s = string.Format("{0}--{0:p}good{1}", 12.34F, Environment.NewLine);
                s += string.Format("{0}--{0:####}good{1}", 0, Environment.NewLine);
                s += string.Format("{0}--{0:00000}good{1}", 456, Environment.NewLine);
                var n = 456;
                var s1 = string.Format("{0}--{0:00000}good", n);
                var s2 = $"n--{n:00000}good";
                s += string.Format("{0}\t{1}", s1, s2);

                label2.Text = s;
            };
        }
    }
}
